package edu.bbu.commonproject.desktop.gui.view.swing.utils;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Image;
import java.util.HashMap;

import javax.swing.ImageIcon;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JTree;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 * The design class.
 */
public class Design
{
	/** The hash map type. */
	private static HashMap<String, Image> typeMap;
	
	/** It initializes the FILE_TYPE_EMPTY. */
	public static final Image FILE_TYPE_EMPTY = new ImageIcon("res/filetypes/empty.png").getImage();
	
	/** It initializes the FILE_TYPE_ACCDB. */
	public static final Image FILE_TYPE_ACCDB = new ImageIcon("res/filetypes/accdb.png").getImage();
	
	/** It initializes the FILE_TYPE_AVI. */
	public static final Image FILE_TYPE_AVI = new ImageIcon("res/filetypes/avi.png").getImage();
	
	/** It initializes the FILE_TYPE_BMP. */
	public static final Image FILE_TYPE_BMP = new ImageIcon("res/filetypes/bmp.png").getImage();
	
	/** It initializes the FILE_TYPE_CSS. */
	public static final Image FILE_TYPE_CSS = new ImageIcon("res/filetypes/css.png").getImage();
	
	/** It initializes the FILE_TYPE_DOCX. */
	public static final Image FILE_TYPE_DOCX = new ImageIcon("res/filetypes/docx.png").getImage();
	
	/** It initializes the FILE_TYPE_EML. */
	public static final Image FILE_TYPE_EML = new ImageIcon("res/filetypes/eml.png").getImage();
	
	/** It initializes the FILE_TYPE_EPS. */
	public static final Image FILE_TYPE_EPS = new ImageIcon("res/filetypes/eps.png").getImage();
	
	/** It initializes the FILE_TYPE_FLA. */
	public static final Image FILE_TYPE_FLA = new ImageIcon("res/filetypes/fls.png").getImage();
	
	/** It initializes the FILE_TYPE_GIF. */
	public static final Image FILE_TYPE_GIF = new ImageIcon("res/filetypes/gif.png").getImage();
	
	/** It initializes the FILE_TYPE_HTML. */
	public static final Image FILE_TYPE_HTML = new ImageIcon("res/filetypes/html.png").getImage();
	
	/** It initializes the FILE_TYPE_IND. */
	public static final Image FILE_TYPE_IND = new ImageIcon("res/filetypes/ind.png").getImage();
	
	/** It initializes the FILE_TYPE_INI. */
	public static final Image FILE_TYPE_INI = new ImageIcon("res/filetypes/ini.png").getImage();
	
	/** It initializes the FILE_TYPE_JPEG. */
	public static final Image FILE_TYPE_JPEG = new ImageIcon("res/filetypes/jpeg.png").getImage();
	
	/** It initializes the FILE_TYPE_JSF. */
	public static final Image FILE_TYPE_JSF = new ImageIcon("res/filetypes/jsf.png").getImage();
	
	/** It initializes the FILE_TYPE_MIDI. */
	public static final Image FILE_TYPE_MIDI = new ImageIcon("res/filetypes/midi.png").getImage();
	
	/** It initializes the FILE_TYPE_MOV. */
	public static final Image FILE_TYPE_MOV = new ImageIcon("res/filetypes/mov.png").getImage();
	
	/** It initializes the FILE_TYPE_MP3. */
	public static final Image FILE_TYPE_MP3 = new ImageIcon("res/filetypes/mp3.png").getImage();
	
	/** It initializes the FILE_TYPE_MPEG. */
	public static final Image FILE_TYPE_MPEG = new ImageIcon("res/filetypes/mpeg.png").getImage();
	
	/** It initializes the FILE_TYPE_PDF. */
	public static final Image FILE_TYPE_PDF = new ImageIcon("res/filetypes/pdf.png").getImage();
	
	/** It initializes the FILE_TYPE_PNG. */
	public static final Image FILE_TYPE_PNG = new ImageIcon("res/filetypes/png.png").getImage();
	
	/** It initializes the FILE_TYPE_PPTX. */
	public static final Image FILE_TYPE_PPTX = new ImageIcon("res/filetypes/pptx.png").getImage();
	
	/** It initializes the FILE_TYPE_PROJ. */
	public static final Image FILE_TYPE_PROJ = new ImageIcon("res/filetypes/proj.png").getImage();
	
	/** It initializes the FILE_TYPE_PSD. */
	public static final Image FILE_TYPE_PSD = new ImageIcon("res/filetypes/psd.png").getImage();
	
	/** It initializes the FILE_TYPE_RAR. */
	public static final Image FILE_TYPE_RAR = new ImageIcon("res/filetypes/rar.png").getImage();
	
	/** It initializes the FILE_TYPE_TXT. */
	public static final Image FILE_TYPE_TXT = new ImageIcon("res/filetypes/txt.png").getImage();
	
	/** It initializes the FILE_TYPE_TIFF. */
	public static final Image FILE_TYPE_TIFF = new ImageIcon("res/filetypes/tiff.png").getImage();
	
	/** It initializes the FILE_TYPE_URL. */
	public static final Image FILE_TYPE_URL = new ImageIcon("res/filetypes/url.png").getImage();
	
	/** It initializes the FILE_TYPE_WAV. */
	public static final Image FILE_TYPE_WAV = new ImageIcon("res/filetypes/wav.png").getImage();
	
	/** It initializes the FILE_TYPE_WMA. */
	public static final Image FILE_TYPE_WMA = new ImageIcon("res/filetypes/wma.png").getImage();
	
	/** It initializes the FILE_TYPE_WMV. */
	public static final Image FILE_TYPE_WMV = new ImageIcon("res/filetypes/wmv.png").getImage();
	
	/** It initializes the FILE_TYPE_XLSX. */
	public static final Image FILE_TYPE_XLSX = new ImageIcon("res/filetypes/xlsx.png").getImage();
	
	/** It initializes the FILE_TYPE_ZIP. */
	public static final Image FILE_TYPE_ZIP = new ImageIcon("res/filetypes/zip.png").getImage();
	
	/** It initializes the FILE_TYPE_EXE. */
	public static final Image FILE_TYPE_EXE = new ImageIcon("res/filetypes/exe.png").getImage();
	
	/** It initializes the FILE_TYPE_DLL. */
	public static final Image FILE_TYPE_DLL = new ImageIcon("res/filetypes/dll.png").getImage();
	
	/**It initializes the FILE_TYPE_BIN. */
	public static final Image FILE_TYPE_BIN = new ImageIcon("res/filetypes/bin.png").getImage();
	
	/** It initializes the FILE_TYPE_SH. */
	public static final Image FILE_TYPE_SH = new ImageIcon("res/filetypes/sh.png").getImage();
	
	/** It initializes the FILE_TYPE_NFO. */
	public static final Image FILE_TYPE_NFO = new ImageIcon("res/filetypes/nfo.png").getImage();
	
	/** It initializes the FILE_TYPE_JAR. */
	public static final Image FILE_TYPE_JAR = new ImageIcon("res/filetypes/jar.png").getImage();
	
	/** It initializes the DIRECTORY_TREE_OPEN. */
	public static final Image DIRECTORY_TREE_OPEN = new ImageIcon("res/directorytree/tree_open.png").getImage();
	
	/** It initializes the DIRECTORY_TREE_CLOSE. */
	public static final Image DIRECTORY_TREE_CLOSE = new ImageIcon("res/directorytree/tree_close.png").getImage();
	
	/** It initializes the DIRECTORY_DIALOG_BACK. */
	public static final Image DIRECTORY_DIALOG_BACK = new ImageIcon("res/directorytree/dialog_back.png").getImage();
	
	/** It initializes the DIALOG_ERROR. */
	public static final Image DIALOG_ERROR = new ImageIcon("res/dialogs/error.png").getImage();
	
	/** It initializes the DIALOG_DELETE. */
	public static final Image DIALOG_DELETE = new ImageIcon("res/dialogs/delete.png").getImage();
	
	/** It initializes the DIALOG_ACCEPT. */
	public static final Image DIALOG_ACCEPT = new ImageIcon("res/dialogs/accept.png").getImage();
	
	/** It initializes the DIALOG_WARNING. */
	public static final Image DIALOG_WARNING = new ImageIcon("res/dialogs/warning.png").getImage();
	
	/** It initializes the DIALOG_NEW_DIRECTORY. */
	public static final Image DIALOG_NEW_DIRECTORY = new ImageIcon("res/dialogs/newdirectory.png").getImage();
	
	/** It initializes the FILELIST_GOBACK. */ 
	public static final Image FILELIST_GOBACK = new ImageIcon("res/filelist/goback.png").getImage();
	
	/** It initializes the FILELIST_DIRECTORY. */ 
	public static final Image FILELIST_DIRECOTRY = new ImageIcon("res/filelist/directory.png").getImage();
	
	/** It initializes the FILELIST_MAOUSEOVER. */ 
	public static final Image FILELIST_MOUSEOVER = new ImageIcon("res/filelist/mouseover.png").getImage();
	
	/** It initializes the FILELIST_MOUSESELECTED. */ 
	public static final Image FILELIST_MOUSESELECTED = new ImageIcon("res/filelist/mouseselected.png").getImage();
	
	/** It initializes the FILELIST_CONTROL_ADD. */  
	public static final Image FILELIST_CONTROL_ADD = new ImageIcon("res/filelistcontrol/add.png").getImage();
	
	/** It initializes the FILELIST_CONTROL_BACK. */  
	public static final Image FILELIST_CONTROL_BACK = new ImageIcon("res/filelistcontrol/back.png").getImage();
	
	/** It initializes the FILELIST_CONTROL_DELETE. */  
	public static final Image FILELIST_CONTROL_DELETE = new ImageIcon("res/filelistcontrol/delete.png").getImage();
	
	/** It initializes the FILELIST_CONTROL_UPLOAD. */  
	public static final Image FILELIST_CONTROL_UPLOAD = new ImageIcon("res/filelistcontrol/upload.png").getImage();
	
	/** It initializes the FILELIST_CONTROL_CURRDIR. */  
	public static final Image FILELIST_CONTROL_CURRDIR = new ImageIcon("res/filelistcontrol/currdir.png").getImage();
	
	/** It initializes the FILELIST_CONTROL_REFRESH. */  
	public static final Image FILELIST_CONTROL_REFRESH = new ImageIcon("res/filelistcontrol/refresh.png").getImage();
	
	/** It initializes the FILELIST_CONTROL_DOWNLOAD. */  
	public static final Image FILELIST_CONTROL_DOWNLOAD = new ImageIcon("res/filelistcontrol/download.png").getImage();
	
	/** It initializes the FILELIST_CONTROL_NAMETEXTURE. */  
	public static final Image FILELIST_CONTROL_NAMETEXTURE = new ImageIcon("res/filelistcontrol/name_texture.png").getImage();
	
	/** It initializes the FILELIST_CONTROL_BASETEXTURE. */  
	public static final Image FILELIST_CONTROL_BASETEXTURE = new ImageIcon("res/filelistcontrol/base_texture.png").getImage();

	/** It initializes the COMPONENT_LOGO. */  
	public static final Image COMPONENT_LOGO = new ImageIcon("res/components/logo.png").getImage();
	
	/** It initializes the COMPONENT_BASETEXTURE. */ 
	public static final Image COMPONENT_BASETEXTURE = new ImageIcon("res/components/basetexture.png").getImage();
	
	/** It initializes the COMPONENT_FORGOTPASSWORD. */ 
	public static final Image COMPONENT_FORGOTPASSWORD = new ImageIcon("res/components/forgotpassword.png").getImage();
	
	/** It initializes the COMPONENT_LOGIN. */ 
	public static final Image COMPONENT_LOGIN = new ImageIcon("res/components/login.png").getImage();
	
	/** It initializes the COMPONENT_REGISTER. */ 
	public static final Image COMPONENT_REGISTER = new ImageIcon("res/components/register.png").getImage();
	
	/** It initializes the COMPONENT_HEADEREXTURE. */ 
	public static final Image COMPONENT_HEADEREXTURE = new ImageIcon("res/components/headertexture.png").getImage();
	
	/** It initializes the COMPONENT_PRIVACY. */ 
	public static final Image COMPONENT_PRIVACY = new ImageIcon("res/components/privacy.png").getImage();
	
	/** It initializes the COMPONENT_SYNCHONIZE. */  
	public static final Image COMPONENT_SYNCHRONIZE = new ImageIcon("res/components/synchronize.png").getImage();
	
	/** It initializes the HEADER_BUTTON_MOUSEOVER. */
	public static final Image HEADER_BUTTON_MOUSEOVER = new ImageIcon("res/headerbuttons/mouseover.png").getImage();
	
	/** It initializes the HEADER_BUTTON_MOUSEPRESS. */
	public static final Image HEADER_BUTTON_MOUSEPRESS = new ImageIcon("res/headerbuttons/mousepress.png").getImage();
	
	/** It initializes the HEADER_BUTTON_SYNC. */
	public static final Image HEADER_BUTTON_SYNC = new ImageIcon("res/headerbuttons/sync.png").getImage();
	
	/** It initializes the HEADER_BUTTON_HELP. */
	public static final Image HEADER_BUTTON_HELP = new ImageIcon("res/headerbuttons/help.png").getImage();
	
	/** It initializes the HEADER_BUTTON_SETUP. */
	public static final Image HEADER_BUTTON_SETUP = new ImageIcon("res/headerbuttons/setup.png").getImage();
	
	/** It initializes the HEADER_BUTTON_LOGOUT. */
	public static final Image HEADER_BUTTON_LOGOUT= new ImageIcon("res/headerbuttons/logout.png").getImage();
	
	/** It initializes the HEADER_BUTTON_LOGIN. */
	public static final Image HEADER_BUTTON_LOGIN = new ImageIcon("res/headerbuttons/login.png").getImage();
	
	/** It initializes the HEADER_BUTTON_REGISTER. */
	public static final Image HEADER_BUTTON_REGISTER= new ImageIcon("res/headerbuttons/register.png").getImage();
	
	/** It initializes the HEADER_BUTTON_FORGOTPASSWORD. */
	public static final Image HEADER_BUTTON_FORGOTPASSWORD = new ImageIcon("res/headerbuttons/forgotpassword.png").getImage();
	
	/** It initializes the HEADER_BUTTON_PRIVACY. */
	public static final Image HEADER_BUTTON_PRIVACY = new ImageIcon("res/headerbuttons/privacy.png").getImage();
	
	/** It initializes the HEADER_BUTTON_SYNCSETUP. */
	public static final Image HEADER_BUTTON_SYNCSETUP = new ImageIcon("res/headerbuttons/syncset.png").getImage();
	
	/** It initializes the HEADER_BUTTON_SETUPEXIT. */
	public static final Image HEADER_BUTTON_SETUPEXIT = new ImageIcon("res/headerbuttons/setupexit.png").getImage();
	
	/** It initializes the TRAFFIC_STATUS. */
	public static final Image TRAFFIC_STATUS = new ImageIcon("res/traffic/status.png").getImage();
	
	/** It initializes the TRAFFIC_SEPARATOR. */
	public static final Image TRAFFIC_SEPARATOR = new ImageIcon("res/traffic/separator.png").getImage();
	
	/** It initializes the TRAFFIC_STATUS_DOWNLOAD. */
	public static final Image TRAFFIC_STATUS_DOWNLOAD = new ImageIcon("res/traffic/download.png").getImage();
	
	/** It initializes the TRAFFIC_STATUS_UPLOAD. */
	public static final Image TRAFFIC_STATUS_UPLOAD = new ImageIcon("res/traffic/upload.png").getImage();
	
	/** It initializes the TRAFFIC_STATUS_FINISHED. */
	public static final Image TRAFFIC_STATUS_FINISHED = new ImageIcon("res/traffic/finished.png").getImage();
	
	/** It initializes the TRAFFIC_STATUS_STOPPED. */
	public static final Image TRAFFIC_STATUS_STOPPED = new ImageIcon("res/traffic/stopped.png").getImage();
	
	/** It initializes the TRAFFIC_STATUS_CRASHED. */
	public static final Image TRAFFIC_STATUS_CRASHED = new ImageIcon("res/traffic/crashed.png").getImage();
	
	/** It initializes the TRAFFIC_STATUS_PAUSED. */
	public static final Image TRAFFIC_STATUS_PAUSED = new ImageIcon("res/traffic/pause.png").getImage();
	
	/** It initializes the TRAFFIC_COMPONENT_ITEM. */
	public static final Image TRAFFIC_COMPONENT_ITEM = new ImageIcon("res/trafficcomponent/listitem.png").getImage();
	
	/** It initializes the TRAFFIC_COMPONENT_SELECTED. */
	public static final Image TRAFFIC_COMPONENT_SELECTED = new ImageIcon("res/trafficcomponent/selected.png").getImage();
	
	/** It initializes the TRAFFIC_COMPONENT_BASETEXTURE. */
	public static final Image TRAFFIC_COMPONENT_BASETEXTURE = new ImageIcon("res/trafficcomponent/base.png").getImage();
	
	/** It initializes the TRAFFIC_COMPONENT_HEADERTEXTURE. */
	public static final Image TRAFFIC_COMPONENT_HEADERTEXTURE = new ImageIcon("res/trafficcomponent/header.png").getImage();
	
	/** It initializes the TRAFFIC_COMPONENT_START. */
	public static final Image TRAFFIC_COMPONENT_START = new ImageIcon("res/trafficcomponent/start.png").getImage();
	
	/** It initializes the TRAFFIC_COMPONENT_PAUSE. */
	public static final Image TRAFFIC_COMPONENT_PAUSE = new ImageIcon("res/trafficcomponent/pause.png").getImage();
	
	/** It initializes the TRAFFIC_COMPONENT_STOP. */
	public static final Image TRAFFIC_COMPONENT_STOP = new ImageIcon("res/trafficcomponent/stop.png").getImage();
	
	/** It initializes the TRAFFIC_COMPONENT_REMOVE. */
	public static final Image TRAFFIC_COMPONENT_REMOVE = new ImageIcon("res/trafficcomponent/remove.png").getImage();
	
	/** It initializes the MENU_LOGIN. */
	public static final Image MENU_LOGIN = new ImageIcon("res/menus/login.png").getImage();
	
	/** It initializes the MENU_FORGOT. */
	public static final Image MENU_FORGOT = new ImageIcon("res/menus/forgot.png").getImage();
	
	/** It initializes the MENU_REGISTER. */
	public static final Image MENU_REGISTER = new ImageIcon("res/menus/register.png").getImage();
	
	/** It initializes the MENU_CLOSE. */
	public static final Image MENU_CLOSE = new ImageIcon("res/menus/close.png").getImage();
	
	/** It initializes the MENU_HELP. */
	public static final Image MENU_HELP = new ImageIcon("res/menus/help.png").getImage();
	
	/** It initializes the MENU_ABOUT. */
	public static final Image MENU_ABOUT = new ImageIcon("res/menus/about.png").getImage();
	
	/** It initializes the MENU_LOGOUT. */
	public static final Image MENU_LOGOUT = new ImageIcon("res/menus/logout.png").getImage();
	
	/** It initializes the MENU_DOWNLOAD. */
	public static final Image MENU_DOWNLOAD = new ImageIcon("res/menus/download.png").getImage();
	
	/** It initializes the MENU_UPLOAD. */
	public static final Image MENU_UPLOAD = new ImageIcon("res/menus/upload.png").getImage();
	
	/** It initializes the MENU_SYNC. */
	public static final Image MENU_SYNC = new ImageIcon("res/menus/sync.png").getImage();
	
	/** It initializes the MENU_SYNCSSETUP. */
	public static final Image MENU_SYNCSSETUP = new ImageIcon("res/menus/syncsetup.png").getImage();
	
	/** It initializes the MENU_PRIVACY. */
	public static final Image MENU_PRIVACY = new ImageIcon("res/menus/privacy.png").getImage();
	
	/** It initializes the BASE_ICON. */
	public static final Image BASE_ICON = new ImageIcon("res/icon/icon.png").getImage();
	
	/** It initializes the HELP_MENU. */
	public static final Image HELP_MENU = new ImageIcon("res/dialogs/help_menu.png").getImage();
	
	/** It initializes the HELP_MENU. */
	public static final Image ABOUT_MENU = new ImageIcon("res/dialogs/about.png").getImage();
	
	
	/** It initializes the HashMap components. */
	static
	{
		typeMap = new HashMap<String, Image>();
		
		typeMap.put(".MDB", FILE_TYPE_ACCDB);
		typeMap.put(".ACCDB", FILE_TYPE_ACCDB);
		typeMap.put(".LDB", FILE_TYPE_ACCDB);
		typeMap.put(".AVI", FILE_TYPE_AVI);
		typeMap.put(".BMP", FILE_TYPE_BMP);
		typeMap.put(".BMPENX", FILE_TYPE_BMP);
		typeMap.put(".BMPP", FILE_TYPE_BMP);
		typeMap.put(".BMP_", FILE_TYPE_BMP);
		typeMap.put(".CSS", FILE_TYPE_CSS);
		typeMap.put(".DOCX", FILE_TYPE_DOCX);
		typeMap.put(".DOC", FILE_TYPE_DOCX);
		typeMap.put(".EML", FILE_TYPE_EML);
		typeMap.put(".EMLX", FILE_TYPE_EML);
		typeMap.put(".EMLXPART", FILE_TYPE_EML);
		typeMap.put(".EPS", FILE_TYPE_EPS);
		typeMap.put(".FLA", FILE_TYPE_FLA);
		typeMap.put(".GIF", FILE_TYPE_GIF);
		typeMap.put(".HTML", FILE_TYPE_HTML);
		typeMap.put(".HTM", FILE_TYPE_HTML);
		typeMap.put(".IND", FILE_TYPE_IND);
		typeMap.put(".INI", FILE_TYPE_INI);
		typeMap.put(".JPEG", FILE_TYPE_JPEG);
		typeMap.put(".JPG", FILE_TYPE_JPEG);
		typeMap.put(".JSF", FILE_TYPE_JSF);
		typeMap.put(".MIDI", FILE_TYPE_MIDI);
		typeMap.put(".MOV", FILE_TYPE_MOV);
		typeMap.put(".MP3", FILE_TYPE_MP3);
		typeMap.put(".M3U", FILE_TYPE_MP3);
		typeMap.put(".MPEG", FILE_TYPE_MPEG);
		typeMap.put(".MPG", FILE_TYPE_MPEG);
		typeMap.put(".PDF", FILE_TYPE_PDF);
		typeMap.put(".PNG", FILE_TYPE_PNG);
		typeMap.put(".PPTX", FILE_TYPE_PPTX);
		typeMap.put(".PPT", FILE_TYPE_PPTX);
		typeMap.put(".PROJ", FILE_TYPE_PROJ);
		typeMap.put(".PSD", FILE_TYPE_PSD);
		typeMap.put(".RAR", FILE_TYPE_RAR);
		typeMap.put(".TXT", FILE_TYPE_TXT);
		typeMap.put(".TIFF", FILE_TYPE_TIFF);
		typeMap.put(".URL", FILE_TYPE_URL);
		typeMap.put(".WAV", FILE_TYPE_WAV);
		typeMap.put(".WMA", FILE_TYPE_WMA);
		typeMap.put(".WMV", FILE_TYPE_WMV);
		typeMap.put(".XLSX", FILE_TYPE_XLSX);
		typeMap.put(".XLS", FILE_TYPE_XLSX);
		typeMap.put(".ZIP", FILE_TYPE_ZIP);
		typeMap.put(".EXE", FILE_TYPE_EXE);
		typeMap.put(".BAT", FILE_TYPE_EXE);
		typeMap.put(".DLL", FILE_TYPE_DLL);
		typeMap.put(".BIN", FILE_TYPE_BIN);
		typeMap.put(".SH", FILE_TYPE_SH);
		typeMap.put(".NFO", FILE_TYPE_NFO);
		typeMap.put(".JAR", FILE_TYPE_JAR);
	}
	
	/**
	 * Gets the file type image.
	 * @param extension the extension name.
	 * @return the file type image.
	 */
	public static Image getFileTypeImage(String extension)
	{
		Image fileTypeImage = typeMap.get(extension);
		
		if(fileTypeImage != null)
		{
			return fileTypeImage;
		}
		
		return FILE_TYPE_EMPTY;
	}
	
	/**
	 * Sets the look and feel.
	 */
	public static void setLookAndFeel()
	{
		try
		{
			UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
		}
		catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e)
		{
			e.printStackTrace();
		}
	}
	
	/**
	 * Sets the tree selected look.
	 * @param tree the selected look.
	 */
	public static void setTreeSelectedLook(JTree tree)
	{
		javax.swing.Painter painter = new javax.swing.Painter()
		{
			public void paint( Graphics2D g, Object object, int width, int height) 
		    { 
		    	g.setColor(new Color(58, 133, 211));
		    	g.fillRect(0, 0, width, height);
		    }
		};
		
		UIDefaults defaults = new UIDefaults();
		defaults.put("Tree:TreeCell[Focused+Selected].backgroundPainter", painter);
		tree.putClientProperty("Nimbus.Overrides", defaults);
	}
	
	/**
	 * Sets the selected menu look.
	 * @param menu the selected look.
	 */
	public static void setMenuSelectedLook(JMenu menu)
	{
		javax.swing.Painter painter = new javax.swing.Painter()
		{
			public void paint( Graphics2D g, Object object, int width, int height) 
		    { 
		    	g.setColor(new Color(58, 133, 211));
		    	g.fillRect(0, 0, width, height);
		    }
		};
		
		UIDefaults defaults = new UIDefaults();
		defaults.put("MenuBar:Menu[Selected].backgroundPainter", painter);
		menu.putClientProperty("Nimbus.Overrides", defaults);
		
		javax.swing.Painter ppainter = new javax.swing.Painter()
		{
			public void paint( Graphics2D g, Object object, int width, int height) 
		    { 
		    	g.setColor(new Color(243, 246, 252));
		    	g.fillRect(0, 0, width, height);
		    	g.setColor(new Color(145, 146, 147));
		    	g.drawRect(0, 0, width-1, height-1);
		    }
		};
		
		UIDefaults pdefaults = new UIDefaults();
		defaults.put("PopupMenu[Enabled].backgroundPainter", ppainter);
		menu.getPopupMenu().putClientProperty("Nimbus.Overrides", defaults);
		
	}
	
	/**
	 * Sets the menu item selected look.
	 * @param menuItem the menu item selected look.
	 */
	public static void setMenuItemSelectedLook(JMenuItem menuItem)
	{
		javax.swing.Painter painter = new javax.swing.Painter()
		{
			public void paint( Graphics2D g, Object object, int width, int height) 
		    { 
		    	g.setColor(new Color(58, 133, 211));
		    	g.fillRect(0, 0, width, height);
		    }
		};
		
		UIDefaults defaults = new UIDefaults();
		defaults.put("MenuItem[MouseOver].backgroundPainter", painter);
		menuItem.putClientProperty("Nimbus.Overrides", defaults);
	}
	
}
